<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Email extends MY_Controller {
      var $_templates = array();
		var $_lang = '';
	
		function __construct() {
			parent::__construct();
			$this->session->set_userdata(array('Url' => uri_string()));
			$this->_lang = $this->lang->lang();
			$this->load->model('email_model', 'email');
		}
	
	
	 function index() {
        $json = array();
		$email = $this->input->post('email');
		$dt_create = date('Y-m-d H:i:s') ;
		$data=array('email'=>$email,'bl_active'=>1,'dt_create'=>$dt_create);
		if($this->email->saveMemberItem($data)){
			$json['status'] = true;
			$json['mess'] = "<strong>Bạn đã đăng ký thành công. Cảm ơn bạn</strong>";
		}else{
			$json['status'] = false;
		}
        echo json_encode($json);
        exit();
    }
}